From: Carlos Garnacho Date: Fri, 25 Feb 2022 12:07:49 +0000 (+0100) Subject: grabHelper: Query stage for target actor instead of event.get_source() X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~516^2^2~30 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4a8b8e6dd553e7bc5491037999adb2d41af0a285;p=gnome-shell.git grabHelper: Query stage for target actor instead of event.get_source() Events are going to stop containing the destinatary, so stop using this API. Querying the stage is equivalent and ensured to be up-to-date. Part-of: --- diff --git a/js/ui/grabHelper.js b/js/ui/grabHelper.js index a46bab0fa..af4641014 100644 --- a/js/ui/grabHelper.js +++ b/js/ui/grabHelper.js @@ -265,9 +265,11 @@ var GrabHelper = class GrabHelper { return Clutter.EVENT_PROPAGATE; } + const targetActor = global.stage.get_event_actor(event); + if (type === Clutter.EventType.ENTER || type === Clutter.EventType.LEAVE || - this.currentGrab.actor.contains(event.get_source())) + this.currentGrab.actor.contains(targetActor)) return Clutter.EVENT_PROPAGATE; if (Main.keyboard.shouldTakeEvent(event)) @@ -279,7 +281,7 @@ var GrabHelper = class GrabHelper { if (press || touchBegin) this._ignoreUntilRelease = true; - let i = this._actorInGrabStack(event.get_source()) + 1; + let i = this._actorInGrabStack(targetActor) + 1; this.ungrab({ actor: this._grabStack[i].actor, isUser: true }); return Clutter.EVENT_STOP; }